From 2137b122b6e4ea8c3f2546b93f0239a615bcd2dc Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Thu, 15 Dec 2005 14:51:10 -0600 Subject: [PATCH] Small patch to avoid a stack overflow (VTI only). Signed-off-by: Tristan Gingold --- tools/libxc/xc_ia64_stubs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/libxc/xc_ia64_stubs.c b/tools/libxc/xc_ia64_stubs.c index 4b11af60e4..ab3a6c1222 100644 --- a/tools/libxc/xc_ia64_stubs.c +++ b/tools/libxc/xc_ia64_stubs.c @@ -182,18 +182,26 @@ static int load_hob(int xc_handle,uint32_t dom, void *hob_buf); int xc_ia64_build_hob(int xc_handle, uint32_t dom, unsigned long memsize){ - char hob_buf[GFW_HOB_SIZE]; + char *hob_buf; + + hob_buf = malloc (GFW_HOB_SIZE); + if (hob_buf == NULL) { + PERROR("Could not allocate hob"); + return -1; + } if ( build_hob( hob_buf, GFW_HOB_SIZE, memsize<<20) < 0){ + free (hob_buf); PERROR("Could not build hob"); return -1; } if ( load_hob( xc_handle, dom, hob_buf) <0){ + free (hob_buf); PERROR("Could not load hob"); return -1; } - + free (hob_buf); return 0; } -- 2.30.2